//
//  CZBaseTableViewController.swift
//  新浪微博
//
//  Created by apple on 15/11/23.
//  Copyright © 2015年 0523. All rights reserved.
//

import UIKit

class CZBaseTableViewController: UITableViewController,CZVistorViewDelegate {
    var userlogin=false
    override func loadView() {
        userlogin ? super.loadView():setupview()
    }
    private func setupview(){
        view=vistorView
   vistorView.delegate=self
//        vistorView.delegate=self
//view.backgroundColor=UIColor.brownColor()
        if self is CZHomeViewController{
            vistorView.rotationanimation()
            NSNotificationCenter.defaultCenter().addObserver(self,  selector:"dide", name: UIApplicationDidBecomeActiveNotification, object: nil)
            NSNotificationCenter.defaultCenter().addObserver(self,  selector:"didf", name: UIApplicationDidEnterBackgroundNotification, object: nil)
        }else if self is CZMessageViewController{
            vistorView.setupvistorview("visitordiscover_image_message", message:  "登录后，别人评论你的微博，发给你的消息，都会在这里收到通知")
        }else if self is CZDiscoverViewControlle{
            vistorView.setupvistorview("visitordiscover_image_message", message:  "登录后，最新、最热微博尽在掌握，不再会与实事潮流擦肩而过")
        }else if self is CZProfileViewController{
            vistorView.setupvistorview("visitordiscover_image_profile", message:  "登录后，你的微博、相册、个人资料会显示在这里，展示给别人")
        }
        navigationItem.leftBarButtonItem=UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action:"vied" )
         navigationItem.rightBarButtonItem=UIBarButtonItem(title: "注册", style: UIBarButtonItemStyle.Plain, target: self, action:"vief" )

    }
    func vied(){
        
    }
    func vief(){
        
    }
private lazy var vistorView: CZVistorView = CZVistorView()
    func dide(){
       vistorView.rotationanimation()
    }
    func didf(){
     vistorView.pauseAnimation()
    }
}
 